﻿#ifndef LOSS_H
#define LOSS_H

#include <QDialog>
#include "env.h"
#include "optioneditor.h"

namespace Ui {
class Loss;
}

class Loss : public QDialog
{
    Q_OBJECT

public:
    explicit Loss(QWidget *parent = 0);
    ~Loss();

    bool init();
    bool saveRecord();
    void updateView();
    void sendMsg(const QString &title,const QString &content);

private slots:
    void on_btn_send_clicked();
    void on_btn_submit_clicked();
    void on_btn_save_clicked();
    void reload(const OptionType &type);

    void on_receiver_currentTextChanged(const QString &text);

private:
    Ui::Loss *ui;
    OptionHandler option;

    QString name,remark;
    QString notice;
    QString receiver;
    QString number;

    QUdpSocket *sender;
    QSqlTableModel *model;
};

#endif // LOSS_H
